home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-08-19 | 1.0 KB | 26 lines | [TEXT/ttxt] |
- global r1:R,r2:R,p1:L,p2:L
- function DoRect
- PenPat gray
- put openPicture(thePort@.portRect) into j
- copyBits thePort@.portBits,thePort@.portBits,thePort@.portRect,thePort@.portRect,0,nil
- closePicture
- repeat until button() -- wait until button is pressed
- end repeat
- GetMouse p1 -- get mouse location without callback
- put LoWord(p1) into pp1 -- put item 1 of loc into pp1
- put HiWord(p1) into pp2 -- put item 1 of loc into pp1
- repeat while Button() -- repeat while button is pressed
- GetMouse p2 -- get mouse location without callback
- if p1≠p2 then -- only redraw if we need to
- SetRect r2,pp1,pp2,LoWord(p2),HiWord(p2) -- set rectangle for frameRect
- DrawPicture j,thePort@.portRect -- redraw HC window
- FrameRect r2 -- draw outline
- put p2 into p1 -- set p1 to p2
- end if
- end repeat
- DrawPicture j,ThePort@.portRect -- redraw HC window
- KillPicture j
- return r2.integerType[2] & "," & r2.integerType[1] & "," & r2.integerType[4] & "," & r2.integerType[3]
- PenPat black
- end DoRect
-